package com.module.app.base.popup

import android.content.Context
import androidx.databinding.ViewDataBinding
import com.module.app.base.loadsir.*
import com.module.base.base.BaseExceptionViewModel
import com.module.base.pop.base.BaseDrawerPopupView

/**
 * Author: yanxuwen
 * Date:  2023/5/17
 * Desc:  封装能含有mvvm的DrawerPopupView
 */
abstract class DrawerPopupView<VM : BaseExceptionViewModel, DB : ViewDataBinding>(context: Context) :
    BaseDrawerPopupView<VM, DB>(context), LoadSirReload {

    override fun onCreate() {
        super.onCreate()
        loadService?.setCallBack(LoadingCallback::class.java) { _, view ->
            MyAppCallback.setLoadingPopup(view)
        }
        loadService?.setCallBack(EmptyCallback::class.java) { _, view ->
            MyAppCallback.setEmptyPopup(view)
        }
        loadService?.setCallBack(ErrorCallback::class.java) { _, view ->
            MyAppCallback.setEmptyPopup(view)
        }
    }
}